<template>
    <div>
        <h1>home page</h1>
        <div id="box" ref="scroll">
            <div>
                <h1 v-for="(item, index) in 50" :key="index">h1标签{{item}}</h1>
            </div>
        </div>
    </div>
</template>

<script>
import BScroll from 'better-scroll';

export default {
    methods: {
        initScroll(){
            this.$nextTick(()=>{
                new BScroll(this.$refs.scroll);
            })
        }
    },
    mounted() {
        this.initScroll();
    },
}
</script>

<style lang="less" scoped>
    #box{
        background-color: #cccccc;
        height: 500px;
        overflow: hidden;
    }
</style>